<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>关注页面</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" href="style/style_content.css" type="text/css" />
		<link rel="stylesheet" href="style/style_frame.css" type="text/css" />
		<script src="images/SlideTrans.js"></script>
		<script type="text/javascript">
			var str="";
			//设置cookie
			function setCookie(name,value){
				var Days = 30; //此 cookie 将被保存 30 天
    			var exp  = new Date();    //new Date("December 31, 9998");
    			exp.setTime(exp.getTime() + Days*24*60*60*1000);
    			document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
			}
			function getCookie(name)//读取cookies函数        
			{
    			var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
     			if(arr != null) return unescape(arr[2]); return null;
			}
			function delCookie(name)//删除cookie
			{
   		 		var exp = new Date();
    			exp.setTime(exp.getTime() - 1);
    			var cval=getCookie(name);
    			if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
			}
			function addRegard(){
				if(!checked())
					alert("确认不设置任何关注信息吗？");
				else{
					setCookie('regard',str);
					alert("设置成功!");
					location.reload();
				}
			}
			function checked(){
			    bool=false;
			    str="";
				ches=document.getElementsByName("che");
				for(i=0;i<ches.length;i++){
					if(ches[i].checked){
						bool=true;
						if(str!="")
							str=str+","+ches[i].value;
						else
							str=ches[i].value;
					}
				}
				return bool;
			}
			function regard(){
				if(getCookie('regard')==null){
					document.getElementById("setRegard").style.display="block";
					document.getElementById("main").style.display="none";
				}
				else{
					document.getElementById("set").style.display="block";
					//iframepage.location.href="information/MyJsp.jsp?regard="+getCookie('regard');
					iframepage.location.href="information/regards.jsp?regard="+getCookie('regard');
				}
			}
			function iFrameHeight() {   
				var ifm= document.getElementById("iframepage");   
				var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;   
				if(ifm != null && subWeb != null) {
		  		 ifm.height = subWeb.body.scrollHeight;
				}   
			}
	 function setRegards(){
			document.getElementById("setRegard").style.display="block";
			document.getElementById("right").style.display="none";
		}	
		</script>
	</head>
	<style>
.che {
	max-height: 40px;
}

.container,.container img {
	width: 900px;
	height: 480px;
}

.container img {
	border: 0;
	vertical-align: top;
}
</style>
	<BODY onload="regard()" style="background-color: #efefef;">
		<div id="container" class="maincontainer" align="center">
			<div class="container" id="idContainer" align="center">
				<table id="idSlider" border="0" cellpadding="0" cellspacing="0"
					align="center" width="80%">
					<tr>
						<td>
							<img src="images/img-1.jpg"></img>
						</td>
						<td>
							<img src="images/img-2.jpg"></img>
						</td>
						<td>
							<img src="images/img-3.jpg"></img>
						</td>
					</tr>
				</table>
			</div>
		</div>
		<script>
	new SlideTrans("idContainer", "idSlider", 3, {
		Vertical : false
	}).Run();
</script>
		<!-- tag:内容区块:新闻 -->
		<div class="contentTitleContainer" style="width: 99%">
			<table class="forword">
				<tr>
					<td>
						<div class="navmenu" style="width: 99%">
							<a href="information/index.jsp">关注</a>
							<a href="information/news.jsp">新闻</a>
							<a href="information/electron.jsp">娱乐</a>
							<a href="information/sports.jsp">体育</a>
							<a href="information/recreation.jsp">科技</a>
						</div>
					</td>
				</tr>
			</table>
		</div>
	<div id="main">
		<iframe id="iframepage" height="100%" width="100%" name="iframepage"
			onload="iFrameHeight()" frameborder="0" scrolling="no">
		</iframe>
</div>
		<div id="setRegard" style="display: none; font-size: 30px;">
			<br />
			<input type="checkbox" value="news" name="che" />
			新闻 &nbsp; &nbsp;
			<input type="checkbox" value="electron" name="che" class="che" />
			娱乐&nbsp; &nbsp;
			<input type="checkbox" value="sports" name="che" />
			体育&nbsp; &nbsp;
			<input type="checkbox" value="recreation" name="che"
				style="height: 13; width: 13; padding: 8" />
			科技&nbsp; &nbsp;
			<input type="button" value="关注" onclick="addRegard()"
				style="font-size: 35px;" />
		</div>
		<div align="right" id="right">
			<input type="button" value="设 置 关 注" id="set" onclick="setRegards()"
				style="font-size: 40px;height: 60;width: 100%;display: none;" />
		</div>
	</BODY>
</html>
